import request from '@/utils/request'
let baseUrl = process.env.NODE_ENV === 'production' ? '/api/risk' : 'riskyf'
// 策略管理列表list
export const getConfigList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/std/alarm-config/index',
    method: 'post',
    data
  })
// 修改启用状态
export const changeStatus = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/std/alarm-config/change-status',
    method: 'post',
    data
  })

// 触发条件保存
export const triggerSave = (data?: any) =>
  request({
    headers: {
      'X-Portal-Name': 'text/plain'
    },
    baseURL: baseUrl,
    url: '/std/alarm-config/trigger',
    method: 'post',
    data
  })
// 处置方式保存
export const touchSave = (data?: any) =>
  request({
    headers: {
      'X-Portal-Name': 'text/plain'
    },
    baseURL: baseUrl,
    url: '/std/alarm-config/touch',
    method: 'post',
    data
  })
// 预警信息列表
export const getApprovalLsit = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/std/alarm-result/index',
    method: 'post',
    data
  })
// 刷新知识包 /std/dmp-config/sync
export const sync = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/std/dmp-config/sync',
    method: 'post',
    data
  })
// 更新预警配置 POST /std/alarm-config/update
export const update = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/std/alarm-config/update',
    method: 'post',
    data
  })
